package HomeWork;

import java.math.BigDecimal;
import java.util.ArrayList;

public class Test2 {
    public static void main(String[] args) {
        ArrayList<Double> s = new ArrayList<>();
        s.add(88.5);
        s.add(86.5);
        s.add(66.5);
        s.add(58.5);
        s.add(Double.valueOf(98));
        s.add(Double.valueOf(88));
        s.add(45.9);
        int count = 0;
        Double sum = 0.0;
        Double max = 0.0;
        Double pingjun = 0.0;
        for (Double d : s) {
            if (d < 60) {
                System.out.println(d);
            }
        }
        BigDecimal bigDecimal = BigDecimal.valueOf(pingjun);
        for (Double b : s) {
            if (b < 60) {
                count++;
            }
            sum += b;
            pingjun = sum/s.size();
             bigDecimal = BigDecimal.valueOf(pingjun);
        }
        System.out.println(bigDecimal);
        System.out.println(sum);
        System.out.println(count);

        for (Double c : s) {
            if (c>max){
                max = c;
            }
        }
        System.out.println(max);
    }
}


